﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MVCFoto.Model;
using System.Data.SqlClient;
using MVCFoto.IDAL;

namespace MVCFoto.SQLServerDAL
{
    public class SystemSettings:ISystemSettings
    {
        private const string SP_GET_SYSYTEMSETTINGS = "mfp_Get_SystemSettings";
        private const string PARM_SETTING = "@Setting";
        private const string PARM_VALUE = "@Value";


        public IList<SystemSettingInfo> GetAllSettings()
        {
            IList<SystemSettingInfo> settings = null;
            using (SqlDataReader sdr = SqlHelper.ExecuteReader(SP_GET_SYSYTEMSETTINGS, null))
            {
                new List<SystemSettingInfo>();
                while (sdr.Read())
                {
                    SystemSettingInfo ssi = new SystemSettingInfo();
                    ssi.Setting = sdr.GetString(0);
                    ssi.Value = sdr.GetString(1);
                    settings.Add(ssi);
                }
                return settings;
            }
        }
    }
}
